// 空对象类型
let person1: {} = {}

let person2: { name: string; age: number; sayHi(): void } = {
  name: '张三',
  age: 30,
  sayHi () {}
}

// 对象类型中的可选属性
// 定义对象类型的时候，注意下，如果换行了，没必须要写;，如果在一行要写
type Person = {
  name: string
  age?: number
  sex?: string
  sayHi: () => void
}

let person3: { name: string; age?: number } = {
  name: 'lisi'
}

let person4: Person = {
  name: 'wangwu',
  sayHi () {}
}

let person5: Person = {
  name: 'wangwu',
  sayHi () {}
}

let p = { name: '张三', age: 100, sayHi () {} }

export {}
